﻿<Window x:Class="Email_Validator.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Email_Validator"
        mc:Ignorable="d"
        Title="Dynamics CRM E-mail Validator &amp; Troubleshooter" Height="610.058" Width="563.962" ResizeMode="NoResize">
    <Grid Margin="0,0,0,-1">
        <GroupBox x:Name="exchgrpBox" Header="Exchange Login" HorizontalAlignment="Left" Margin="10,261,0,0" VerticalAlignment="Top" Height="258" Width="528">
            <Grid HorizontalAlignment="Left" Height="289" Margin="0,10,-2,-68" VerticalAlignment="Top" Width="518">
                <TextBox x:Name="exchuserTxtBox" HorizontalAlignment="Left" Height="16" Margin="10,42,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="231" FontSize="10.667"/>
                <Label x:Name="exchuserLbl" Content="Username" HorizontalAlignment="Left" Margin="10,20,0,0" VerticalAlignment="Top" FontSize="10.667"/>
                <PasswordBox x:Name="exchPwdBox" HorizontalAlignment="Left" Margin="10,81,0,0" VerticalAlignment="Top" Width="231" FontSize="10.667"/>
                <Label x:Name="label" Content="Password" HorizontalAlignment="Left" Margin="10,58,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.324,-0.117" FontSize="10.667"/>
                <TextBox x:Name="ewsTxtBox" HorizontalAlignment="Left" Height="16" Margin="10,164,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="498" Text="https://&lt;server&gt;/ews/exchange.asmx" FontSize="10.667"/>
                <Label x:Name="label1" Content="Exchange Web Service URL" HorizontalAlignment="Left" Margin="10,140,0,0" VerticalAlignment="Top" FontSize="10.667" RenderTransformOrigin="0.517,-0.642"/>
                <CheckBox x:Name="impersonchckBox" Content="Use Impersonation" HorizontalAlignment="Left" Margin="264,0,0,0" VerticalAlignment="Top" FontSize="10.667" Checked="checkBox_Checked" Unchecked ="checkBox_Unchecked" RenderTransformOrigin="0.468,-0.533"/>
                <TextBox x:Name="smtpaddTxtBox" HorizontalAlignment="Left" Height="16" Margin="264,42,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="227" FontSize="10.667" Visibility="Visible" RenderTransformOrigin="0.519,9.062"/>
                <Button x:Name="btnLogin" Content="Sign In" HorizontalAlignment="Left" Margin="10,197,0,0" VerticalAlignment="Top" Width="142" Click="btnLogin_Click" RenderTransformOrigin="0.526,1.35" Height="22"/>
                <CheckBox x:Name="exchangeOnlinechkBox" Content="Exchange Online" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top" FontSize="10.667" IsChecked="False" Checked="exchangeOnlinechkBox_Checked" Unchecked="exchangeOnlinechkBox_Unchecked"/>
                <ComboBox x:Name="exchversionCmbBox" HorizontalAlignment="Left" Margin="264,121,0,0" VerticalAlignment="Top" Width="198" SelectedIndex="1" Height="23" FontSize="10.667">
                    <ComboBoxItem Content="Exchange 2010" FontSize="10.667"/>
                    <ComboBoxItem Content="Exchange 2013" FontSize="10.667"/>
                    <ComboBoxItem Content="Exchange 2016" FontSize="10.667"/>
                </ComboBox>
                <Label x:Name="exchversionLbl" Content="Exchange Version" HorizontalAlignment="Left" Margin="264,97,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.421,-0.154" FontSize="10.667"/>
                <TextBox x:Name="exchDomainTxtBox" HorizontalAlignment="Left" Height="16" Margin="10,121,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="231" FontSize="10.667"/>
                <Label x:Name="exchDomainLbl" Content="Domain" HorizontalAlignment="Left" Margin="10,97,0,0" VerticalAlignment="Top" FontSize="10.667"/>
                <Label x:Name="smtpLbl" Content="Smtp Address" HorizontalAlignment="Left" Margin="264,20,0,0" VerticalAlignment="Top" FontSize="10.667" Visibility="Visible"/>
                <Button x:Name="resetExchbtn" Content="Reset Configuration" HorizontalAlignment="Left" Margin="366,194,0,0" VerticalAlignment="Top" Width="142" Click="resetExchbtn_Click" Height="23"/>
                <Image x:Name="exchangeGreenCheck" HorizontalAlignment="Left" Height="25" VerticalAlignment="Top" Width="22" Margin="170,194,0,0" Source="GreenCheck.png" Visibility="Hidden"/>
                <GroupBox x:Name="grpBoxExchangeMailbox" Header="Impersonation" HorizontalAlignment="Left" Margin="254,-17,0,0" VerticalAlignment="Top" Height="87" Width="254"/>
            </Grid>
        </GroupBox>
        <Button x:Name="goBtn" Content="Go" HorizontalAlignment="Left" Margin="225,528,0,0" VerticalAlignment="Top" Width="96" RenderTransformOrigin="1.442,0.447" Height="32" Click="goBtn_Click" IsEnabled="False"/>
        <GroupBox x:Name="crmdepgrpBox" Header="CRM Login (System Administrator)" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="246" Width="528" BorderThickness="1">
            <Grid Height="241" VerticalAlignment="Top" Margin="0,-5,-12,-12">
                <TextBox x:Name="usernameTxtBox" HorizontalAlignment="Left" Height="16" Margin="7,56,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="231" FontSize="10.667" TextChanged="usernameTxtBox_TextChanged"/>
                <PasswordBox x:Name="passwordBox" HorizontalAlignment="Left" Margin="7,94,0,0" VerticalAlignment="Top" Width="231" Height="16" RenderTransformOrigin="0.499,1.547" FontSize="10.667"/>
                <Label x:Name="usernameLbl" Content="Username" HorizontalAlignment="Left" Margin="7,34,0,0" VerticalAlignment="Top" FontSize="10.667" RenderTransformOrigin="-0.021,-0.294"/>
                <Label x:Name="passwordLbl" Content="Password" HorizontalAlignment="Left" Margin="7,72,0,0" VerticalAlignment="Top" FontSize="10.667" RenderTransformOrigin="0.134,-0.079"/>
                <TextBox x:Name="discoveryTxtBox" HorizontalAlignment="Left" Height="16" Margin="10,170,0,0" TextWrapping="Wrap" Text="https://disco.crm.dynamics.com/XrmServices/2011/Discovery.svc" VerticalAlignment="Top" Width="504" FontSize="10.667"/>
                <Label x:Name="discoveryLbl" Content="Discovery Service URL" HorizontalAlignment="Left" Margin="8,148,0,0" VerticalAlignment="Top" FontSize="10.667" RenderTransformOrigin="0.048,0.415"/>
                <Button x:Name="getorgsBtn" Content="Sign In" HorizontalAlignment="Left" Margin="7,199,0,0" VerticalAlignment="Top" Width="144" Height="22" Click="getorgsBtn_Click"/>
                <ComboBox x:Name="orgsComboBox" HorizontalAlignment="Left" Margin="266,109,0,0" VerticalAlignment="Top" Width="195" DisplayMemberPath="FriendlyName" SelectionChanged="orgsComboBox_SelectionChanged"/>
                <Label x:Name="domainLbl" Content="Domain" HorizontalAlignment="Left" Margin="10,109,0,0" VerticalAlignment="Top" FontSize="10.667" Width="108" Visibility="Visible"/>
                <TextBox x:Name="domainTxtBox" HorizontalAlignment="Left" Height="16" Margin="7,132,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="231" FontSize="10.667" Visibility="Visible" RenderTransformOrigin="0.761,0.615" IsEnabled="False"/>
                <CheckBox x:Name="onpremChkBox" Content="On Premise" HorizontalAlignment="Left" Margin="10,14,0,0" VerticalAlignment="Top" Checked="onpremChkBox_Checked" Unchecked="onpremChkBox_Unchecked" FontSize="10.667" RenderTransformOrigin="0.568,-2.2"/>
                <Image x:Name="crmGreenCheck" HorizontalAlignment="Left" Height="22" Margin="173,199,0,0" VerticalAlignment="Top" Width="27" Source="GreenCheck.png" Visibility="Hidden" RenderTransformOrigin="0.444,-0.409"/>
                <CheckBox x:Name="isQueuechkbox" Content="Mailbox Is Queue" HorizontalAlignment="Left" Margin="266,18,0,0" VerticalAlignment="Top" FontSize="10.667" Checked="isQueuechkbox_Checked" Unchecked="IsQueuechkbox_Unchecked"/>
                <Label x:Name="targetLbl" Content="Target Mailbox Email Address" HorizontalAlignment="Left" Margin="266,34,0,0" VerticalAlignment="Top" FontSize="10.667" Visibility="Visible"/>
                <TextBox x:Name="txtTargetMailbox" HorizontalAlignment="Left" Height="16" Margin="266,56,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="235" FontSize="10.667" Visibility="Visible"/>
                <Button x:Name="resetCrmbtn" Content="Reset Configuration" HorizontalAlignment="Left" Margin="370,199,0,0" VerticalAlignment="Top" Width="144" Height="22" Click="resetCrmbtn_Click"/>
                <GroupBox x:Name="grpBoxCRMOrg" Header="CRM Organization &amp; Mailbox " HorizontalAlignment="Left" Margin="256,0,0,0" VerticalAlignment="Top" Height="148" Width="258"/>
            </Grid>
        </GroupBox>
        <Label x:Name="lblCrmOrg" Content="CRM Organization" HorizontalAlignment="Left" Margin="282,103,0,0" VerticalAlignment="Top" Width="111" FontSize="10.667"/>
    </Grid>
</Window>
